import {
  CTX,
  IControlController,
  IControlProvider,
} from '@ibiz-template/runtime';
import { IControl } from '@ibiz/model-core';
import { ControlPluginController } from './control.controller';

/**
 * 部件插件适配器
 *
 * @author lxm
 * @date 2022-10-25 18:10:57
 * @export
 * @class ControlPluginProvider
 * @implements {IControlProvider}
 */
export class ControlPluginProvider implements IControlProvider {
  component: string = 'IBizControlPlugin';

  createController(
    model: IControl,
    context: IContext,
    params: IParams,
    ctx: CTX,
  ): IControlController {
    return new ControlPluginController(model, context, params, ctx);
  }
}
